package sample.sub1.section08

import scala.io.Source;

object LongLines {
	def processFile(fileName: String, width: Int) {
		val source = Source.fromFile(fileName);
		for (line <- source.getLines()) {
			processLine(fileName, width, line);
		}
	}

	def processLine(fileName: String, width: Int, line: String) {
		if (line.length() > width) {
			println(fileName + ":" + line.trim);
		}
	}

}